﻿using Simple.Contracts.Enums.Common;
using Simple.Contracts.Models;
using Simple.Contracts.Models.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Contracts.Contracts
{
    /// <summary>
    /// 微信服务
    /// </summary>
    public interface IWeChatService
    {
        /// <summary>
        /// 获取唯一访问凭证
        /// https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getAccessToken.html
        /// </summary>
        /// <param name="weChatAppClient"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        Task<string> GetAccessToken(WeChatAppClientEnum weChatAppClient);

        /// <summary>
        /// 登录凭证校验,获取openid和unionid
        /// https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-login/code2Session.html
        /// </summary>
        /// <param name="weChatAppClient"></param>
        /// <param name="js_code"></param>
        /// <returns></returns>
        Task<WeChatSessionDto> GetJScode2Session(WeChatAppClientEnum weChatAppClient, string js_code);

        /// <summary>
        /// 恩睦照护小程序登录
        /// </summary>
        /// <param name="js_code"></param>
        /// <returns></returns>
        Task<Result<WeChatZhaohuAppletLoginDto>> WeChatZhaohuAppletLogin(string js_code);

        /// <summary>
        /// 恩睦照护小程序注册
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<Result<WeChatZhaohuAppletLoginDto>> WeChatZhaohuAppletRegister(WeChatZhaohuAppletRegisterInput input);
    }
}
